package com.hsy.authorization.mvp.ui.adapter;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.jess.arms.base.BaseFragment;

import java.util.List;

public class MainAuthorizeAdapter extends FragmentPagerAdapter {
    private List<BaseFragment> fragments;
    String[] titles;
    public MainAuthorizeAdapter(FragmentManager fm, List<BaseFragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int i) {
        return fragments.get(i);
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {

        return titles[position];
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    public void setTitles(String[] titles) {
        this.titles = titles;
    }
}
